﻿using System.Collections.Generic;

namespace ToolKitIESiteList.Library
{
    public class DataDiscoveryDocModeHostComparer : IEqualityComparer<DataDiscovery>
    {
        public bool Equals(DataDiscovery x, DataDiscovery y)
        {
            return string.Format("{0}{1}", x.Url.GetHostAndPort(), x.DocMode).Equals(string.Format("{0}{1}", y.Url.GetHostAndPort(), y.DocMode));
        }

        public int GetHashCode(DataDiscovery obj)
        {
            return string.Format("{0}{1}", obj.Url.GetHostAndPort(), obj.DocMode).GetHashCode();
        }
    }
 
}
